load("//bazel:macros.bzl", "exports_files_legacy", "split_srcs_and_hdrs")

licenses(["notice"])

exports_files_legacy()

CORE_FILES = [
    "Sk4px.h",
    "SkAAClip.cpp",
    "SkAAClip.h",
    "SkASAN.h",
    "SkATrace.cpp",
    "SkATrace.h",
    "SkAdvancedTypefaceMetrics.h",
    "SkAlphaRuns.cpp",
    "SkAnalyticEdge.cpp",
    "SkAnalyticEdge.h",
    "SkAnnotation.cpp",
    "SkAnnotationKeys.h",
    "SkAntiRun.h",
    "SkArenaAlloc.cpp",
    "SkArenaAlloc.h",
    "SkArenaAllocList.h",
    "SkAutoBlitterChoose.h",
    "SkAutoMalloc.h",
    "SkAutoPixmapStorage.cpp",
    "SkAutoPixmapStorage.h",
    "SkBBHFactory.cpp",
    "SkBigPicture.cpp",
    "SkBigPicture.h",
    "SkBitmap.cpp",
    "SkBitmapCache.cpp",
    "SkBitmapCache.h",
    "SkBitmapDevice.cpp",
    "SkBitmapDevice.h",
    "SkBitmapProcState.cpp",
    "SkBitmapProcState.h",
    "SkBitmapProcState_matrixProcs.cpp",
    "SkBlendMode.cpp",
    "SkBlendModeBlender.cpp",
    "SkBlendModeBlender.h",
    "SkBlendModePriv.h",
    "SkBlenderBase.h",
    "SkBlitBWMaskTemplate.h",
    "SkBlitRow.h",
    "SkBlitRow_D32.cpp",
    "SkBlitter.cpp",
    "SkBlitter.h",
    "SkBlitter_A8.cpp",
    "SkBlitter_ARGB32.cpp",
    "SkBlitter_RGB565.cpp",
    "SkBlitter_Sprite.cpp",
    "SkBlockAllocator.cpp",
    "SkBlockAllocator.h",
    "SkBlurMF.cpp",
    "SkBlurMask.cpp",
    "SkBlurMask.h",
    "SkBuffer.cpp",
    "SkBuffer.h",
    "SkBuiltInCodeSnippetID.h",
    "SkCachedData.cpp",
    "SkCachedData.h",
    "SkCanvas.cpp",
    "SkCanvasPriv.cpp",
    "SkCanvasPriv.h",
    "SkCapabilities.cpp",
    "SkChromeRemoteGlyphCache.cpp",
    "SkClipStack.cpp",
    "SkClipStack.h",
    "SkClipStackDevice.cpp",
    "SkClipStackDevice.h",
    "SkColor.cpp",
    "SkColorFilter.cpp",
    "SkColorFilterBase.h",
    "SkColorFilterPriv.h",
    "SkColorFilter_Matrix.cpp",
    "SkColorFilter_Matrix.h",
    "SkColorSpace.cpp",
    "SkColorSpacePriv.h",
    "SkColorSpaceXformSteps.cpp",
    "SkColorSpaceXformSteps.h",
    "SkCompressedDataUtils.cpp",
    "SkCompressedDataUtils.h",
    "SkContourMeasure.cpp",
    "SkConvertPixels.cpp",
    "SkConvertPixels.h",
    "SkCoreBlitters.h",
    "SkCpu.cpp",
    "SkCpu.h",
    "SkCubicClipper.cpp",
    "SkCubicClipper.h",
    "SkCubicMap.cpp",
    "SkCubicSolver.h",
    "SkData.cpp",
    "SkDataTable.cpp",
    "SkDebug.cpp",
    "SkDebugUtils.h",
    "SkDeferredDisplayList.cpp",
    "SkDeferredDisplayListPriv.h",
    "SkDeferredDisplayListRecorder.cpp",
    "SkDeque.cpp",
    "SkDescriptor.cpp",
    "SkDescriptor.h",
    "SkDevice.cpp",
    "SkDevice.h",
    "SkDiscardableMemory.h",
    "SkDistanceFieldGen.cpp",
    "SkDistanceFieldGen.h",
    "SkDocument.cpp",
    "SkDraw.cpp",
    "SkDraw.h",
    "SkDrawLooper.cpp",
    "SkDrawProcs.h",
    "SkDrawShadowInfo.cpp",
    "SkDrawShadowInfo.h",
    "SkDraw_atlas.cpp",
    "SkDraw_text.cpp",
    "SkDraw_vertices.cpp",
    "SkDrawable.cpp",
    "SkEdge.cpp",
    "SkEdge.h",
    "SkEdgeBuilder.cpp",
    "SkEdgeBuilder.h",
    "SkEdgeClipper.cpp",
    "SkEdgeClipper.h",
    "SkEffectPriv.h",
    "SkEndian.h",
    "SkEnumBitMask.h",
    "SkEnumerate.h",
    "SkExecutor.cpp",
    "SkFDot6.h",
    "SkFlattenable.cpp",
    "SkFont.cpp",
    "SkFontDescriptor.cpp",
    "SkFontDescriptor.h",
    "SkFontMgr.cpp",
    "SkFontPriv.h",
    "SkFontStream.cpp",
    "SkFontStream.h",
    "SkFont_serial.cpp",
    "SkFuzzLogging.h",
    "SkGaussFilter.cpp",
    "SkGaussFilter.h",
    "SkGeometry.cpp",
    "SkGeometry.h",
    "SkGlobalInitialization_core.cpp",
    "SkGlyph.cpp",
    "SkGlyph.h",
    "SkGlyphBuffer.cpp",
    "SkGlyphBuffer.h",
    "SkGlyphRunPainter.cpp",
    "SkGlyphRunPainter.h",
    "SkGpuBlurUtils.cpp",
    "SkGpuBlurUtils.h",
    "SkGraphics.cpp",
    "SkHalf.cpp",
    "SkICC.cpp",
    "SkICCPriv.h",
    "SkIDChangeListener.cpp",
    "SkIPoint16.h",
    "SkImageFilter.cpp",
    "SkImageFilterCache.cpp",
    "SkImageFilterCache.h",
    "SkImageFilterTypes.cpp",
    "SkImageFilterTypes.h",
    "SkImageFilter_Base.h",
    "SkImageGenerator.cpp",
    "SkImageInfo.cpp",
    "SkImagePriv.h",
    "SkLRUCache.h",
    "SkLatticeIter.cpp",
    "SkLatticeIter.h",
    "SkLeanWindows.h",
    "SkLineClipper.cpp",
    "SkLineClipper.h",
    "SkLocalMatrixImageFilter.cpp",
    "SkLocalMatrixImageFilter.h",
    "SkM44.cpp",
    "SkMD5.cpp",
    "SkMD5.h",
    "SkMSAN.h",
    "SkMalloc.cpp",
    "SkMallocPixelRef.cpp",
    "SkMask.cpp",
    "SkMask.h",
    "SkMaskBlurFilter.cpp",
    "SkMaskBlurFilter.h",
    "SkMaskCache.cpp",
    "SkMaskCache.h",
    "SkMaskFilter.cpp",
    "SkMaskFilterBase.h",
    "SkMaskGamma.cpp",
    "SkMaskGamma.h",
    "SkMath.cpp",
    "SkMathPriv.h",
    "SkMatrix.cpp",
    "SkMatrixImageFilter.cpp",
    "SkMatrixImageFilter.h",
    "SkMatrixInvert.cpp",
    "SkMatrixInvert.h",
    "SkMatrixPriv.h",
    "SkMatrixProvider.h",
    "SkMatrixUtils.h",
    "SkMesh.cpp",
    "SkMeshPriv.h",
    "SkMessageBus.h",
    "SkMipmap.cpp",
    "SkMipmap.h",
    "SkMipmapAccessor.cpp",
    "SkMipmapAccessor.h",
    "SkMipmapBuilder.h",
    "SkModeColorFilter.cpp",
    "SkModeColorFilter.h",
    "SkNextID.h",
    "SkOSFile.h",
    "SkOpts.cpp",
    "SkOpts.h",
    "SkOpts_erms.cpp",
    "SkOverdrawCanvas.cpp",
    "SkPaint.cpp",
    "SkPaintDefaults.h",
    "SkPaintPriv.cpp",
    "SkPaintPriv.h",
    "SkPath.cpp",
    "SkPathBuilder.cpp",
    "SkPathEffect.cpp",
    "SkPathEffectBase.h",
    "SkPathMakers.h",
    "SkPathMeasure.cpp",
    "SkPathMeasurePriv.h",
    "SkPathPriv.h",
    "SkPathRef.cpp",
    "SkPath_serial.cpp",
    "SkPicture.cpp",
    "SkPictureData.cpp",
    "SkPictureData.h",
    "SkPictureFlat.cpp",
    "SkPictureFlat.h",
    "SkPictureImageGenerator.cpp",
    "SkPicturePlayback.cpp",
    "SkPicturePlayback.h",
    "SkPicturePriv.h",
    "SkPictureRecord.cpp",
    "SkPictureRecord.h",
    "SkPictureRecorder.cpp",
    "SkPipelineData.h",
    "SkPixelRef.cpp",
    "SkPixelRefPriv.h",
    "SkPixmap.cpp",
    "SkPixmapPriv.h",
    "SkPoint.cpp",
    "SkPoint3.cpp",
    "SkPointPriv.h",
    "SkPromiseImageTexture.cpp",
    "SkPtrRecorder.cpp",
    "SkPtrRecorder.h",
    "SkQuadClipper.cpp",
    "SkQuadClipper.h",
    "SkRRect.cpp",
    "SkRRectPriv.h",
    "SkRTree.cpp",
    "SkRTree.h",
    "SkRasterClip.cpp",
    "SkRasterClip.h",
    "SkRasterClipStack.h",
    "SkRasterPipeline.cpp",
    "SkRasterPipeline.h",
    "SkRasterPipelineBlitter.cpp",
    "SkReadBuffer.cpp",
    "SkReadBuffer.h",
    "SkRecord.cpp",
    "SkRecord.h",
    "SkRecordDraw.cpp",
    "SkRecordDraw.h",
    "SkRecordOpts.cpp",
    "SkRecordOpts.h",
    "SkRecordPattern.h",
    "SkRecordedDrawable.cpp",
    "SkRecordedDrawable.h",
    "SkRecorder.cpp",
    "SkRecorder.h",
    "SkRecords.cpp",
    "SkRecords.h",
    "SkRect.cpp",
    "SkRectPriv.h",
    "SkRegion.cpp",
    "SkRegionPriv.h",
    "SkRegion_path.cpp",
    "SkResourceCache.cpp",
    "SkResourceCache.h",
    "SkRuntimeEffectDictionary.h",
    "SkRuntimeEffectPriv.h",
    "SkSafeMath.h",
    "SkSafeRange.h",
    "SkSamplingPriv.h",
    "SkScalar.cpp",
    "SkScaleToSides.h",
    "SkScalerCache.cpp",
    "SkScalerCache.h",
    "SkScalerContext.cpp",
    "SkScalerContext.h",
    "SkScan.cpp",
    "SkScan.h",
    "SkScanPriv.h",
    "SkScan_AAAPath.cpp",
    "SkScan_AntiPath.cpp",
    "SkScan_Antihair.cpp",
    "SkScan_Hairline.cpp",
    "SkScan_Path.cpp",
    "SkScopeExit.h",
    "SkSemaphore.cpp",
    "SkSharedMutex.cpp",
    "SkSharedMutex.h",
    "SkSpecialImage.cpp",
    "SkSpecialImage.h",
    "SkSpecialSurface.cpp",
    "SkSpecialSurface.h",
    "SkSpinlock.cpp",
    "SkSpriteBlitter.h",
    "SkSpriteBlitter_ARGB32.cpp",
    "SkSpriteBlitter_RGB565.cpp",
    "SkStream.cpp",
    "SkStreamPriv.h",
    "SkStrikeCache.cpp",
    "SkStrikeCache.h",
    "SkStrikeSpec.cpp",
    "SkStrikeSpec.h",
    "SkString.cpp",
    "SkStringUtils.cpp",
    "SkStringUtils.h",
    "SkStroke.cpp",
    "SkStroke.h",
    "SkStrokeRec.cpp",
    "SkStrokerPriv.cpp",
    "SkStrokerPriv.h",
    "SkSurfaceCharacterization.cpp",
    "SkSurfacePriv.h",
    "SkSwizzle.cpp",
    "SkTBlockList.h",
    "SkTDPQueue.h",
    "SkTDynamicHash.h",
    "SkTInternalLList.h",
    "SkTLazy.h",
    "SkTMultiMap.h",
    "SkTSearch.cpp",
    "SkTSearch.h",
    "SkTSort.h",
    "SkTaskGroup.cpp",
    "SkTaskGroup.h",
    "SkTextBlob.cpp",
    "SkTextBlobPriv.h",
    "SkTextBlobTrace.cpp",
    "SkTextBlobTrace.h",
    "SkTextFormatParams.h",
    "SkThreadID.cpp",
    "SkTime.cpp",
    "SkTraceEvent.h",
    "SkTraceEventCommon.h",
    "SkTypeface.cpp",
    "SkTypefaceCache.cpp",
    "SkTypefaceCache.h",
    "SkTypeface_remote.cpp",
    "SkTypeface_remote.h",
    "SkUnPreMultiply.cpp",
    "SkUtils.cpp",
    "SkUtils.h",
    "SkUtilsArm.cpp",
    "SkVM.cpp",
    "SkVM.h",
    "SkVMBlitter.cpp",
    "SkVMBlitter.h",
    "SkVM_fwd.h",
    "SkValidationUtils.h",
    "SkVertState.cpp",
    "SkVertState.h",
    "SkVertices.cpp",
    "SkVerticesPriv.h",
    "SkWriteBuffer.cpp",
    "SkWriteBuffer.h",
    "SkWritePixelsRec.h",
    "SkWriter32.cpp",
    "SkWriter32.h",
    "SkXfermode.cpp",
    "SkXfermodeInterpretation.cpp",
    "SkXfermodeInterpretation.h",
    "SkXfermodePriv.h",
    "SkYUVAInfo.cpp",
    "SkYUVAInfoLocation.h",
    "SkYUVAPixmaps.cpp",
    "SkYUVMath.cpp",
    "SkYUVMath.h",
    "SkYUVPlanesCache.cpp",
    "SkYUVPlanesCache.h",
    "SkZip.h",
]

split_srcs_and_hdrs(
    name = "core",
    files = CORE_FILES,
)

# These files are only needed if SkSL is enabled (GPU backend or SkVM).
SKSL_FILES = [
    "SkKeyContext.h",
    "SkKeyHelpers.cpp",
    "SkKeyHelpers.h",
    "SkPaintParamsKey.cpp",
    "SkPaintParamsKey.h",
    "SkRuntimeEffect.cpp",
    "SkSLTypeShared.cpp",
    "SkSLTypeShared.h",
    "SkShaderCodeDictionary.cpp",
    "SkShaderCodeDictionary.h",
    "SkUniform.h",
]

split_srcs_and_hdrs(
    name = "sksl",
    files = SKSL_FILES,
)

filegroup(
    name = "srcs",
    srcs = [":core_srcs"] + select({
        "//src/sksl:needs_sksl": [
            ":sksl_srcs",
        ],
        "//conditions:default": [],
    }),
    visibility = ["//src:__pkg__"],
)

filegroup(
    name = "private_hdrs",
    srcs = [":core_hdrs"] + select({
        "//src/sksl:needs_sksl": [
            ":sksl_hdrs",
        ],
        "//conditions:default": [],
    }),
    visibility = ["//src:__pkg__"],
)
